<?php

/**
 * 
 *
 * @version $Id: h_news.inc.php,v 1.4 2004/12/31 14:35:57 phppc Exp $
 * @copyright 2004 
 **/

if ($this->db_config["show_h_news"] == 1) {
	if(!isset($_GET["page"])) $_GET["page"] = 0;
	if(!isset($_GET["kat_id"])) $_GET["kat_id"] = 0;
	$header_ones = "";
	$where_time = " WHERE (".$this->config["prefix"]."main.time_start <= ".time().") AND (".$this->config["prefix"]."main.time_end >= ".time()." OR ".$this->config["prefix"]."main.time_end = \"0\") ";
	$erg = $this->db_abfrage_q("SELECT news_id,n_title,anzahl_coms,time_start FROM ".$this->config["prefix"]."main ".$where_time." AND active=\"1\" ORDER by time_start DESC LIMIT 0,".$this->db_config["h_news"]."");
	while($header_news = $this->db_abfrage_fetch($erg)){
		unset($show_points);
		$news_id = $header_news["news_id"];
		if(!isset($this->h_news_on["$news_id"])) $this->h_news_on["$news_id"] = "";
		$nav_erweiterung = "kat_id=".$_GET["kat_id"]."&page=$_GET[page]";
		if($this->h_news_on["$news_id"] == 1) {
			$nav_erweiterung2 = "#nc$news_id";
			$this->module_new_value["action"] = "show";
		}
		else {
			$nav_erweiterung2 = "&news_id=$news_id";
			$this->module_new_value["action"] = "com";
		}
		$h_news_link = $this->fun_make_link("","$nav_erweiterung$nav_erweiterung2");
		list($h_title) = $this->fun_lim_news($header_news["n_title"],$this->db_config["hnews_begr"],$this->db_config["lim_header"],1);
		list($start_date,$start_time) = $this->fun_tstamp2date($header_news["time_start"]);
		$com_link = $this->fun_make_link("","nc_action=com&news_id=$news_id");
		$this->tpl_load("news_header_one");
		$this->tpl_replace_vars(array("h_title" => $h_title,"anzahl_coms" => $header_news["anzahl_coms"],"start_date" => $start_date,"start_time" => $start_time,"h_news_link" => $h_news_link,"com_link" => $com_link,"complete_title" => $header_news["n_title"]));
		$header_ones .= $this->tpl_output();
	} // while
	$this->tpl_load("news_header");
	$this->tpl_replace_vars(array("header_ones" => $header_ones));
	$this->tpl_h_news = $this->tpl_output();
}

?>